package com.Eastiy.EXO;

import android.content.Context;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import com.Eastiy.EXO.View.LTextView;
import java.util.ArrayList;

public class Sidebar {
    private static Context context;
    private PopupWindow BarPop = new PopupWindow(context);
    private LinearLayout lineBar;
    private ArrayList list = new ArrayList();

    public Sidebar(Context context2, String str) {
        context = context2;
        this.BarPop.setTouchable(false);
        this.lineBar = new LinearLayout(context);
        this.lineBar.setOrientation(1);
        this.lineBar.setBackgroundColor(0);
        LTextView lTextView = new LTextView(context);
        lTextView.setText(str);
        lTextView.setTextSize((float) 16);
        this.lineBar.addView(lTextView);
        this.BarPop.setBackgroundDrawable(context.getResources().getDrawable(17170445));
        this.BarPop.setContentView(this.lineBar);
        this.BarPop.showAtLocation(this.lineBar, 53, (int) (((double) m33W()) * 0.1d), (int) (((double) m32H()) * 0.13d));
    }

    /* renamed from: H */
    public static int m32H() {
        return context.getResources().getDisplayMetrics().heightPixels;
    }

    /* renamed from: W */
    public static int m33W() {
        return context.getResources().getDisplayMetrics().widthPixels;
    }

    public void addSideBar(String str) {
        LTextView lTextView = new LTextView(context);
        lTextView.setText(str);
        this.list.add(str);
        this.lineBar.addView(lTextView);
    }

    public void removeSideBar(String str) {
        for (int i = 0; i < this.list.size(); i++) {
            if (this.list.get(i).toString().equals(str)) {
                this.lineBar.removeViewAt(i + 1);
                this.list.remove(i);
                return;
            }
        }
    }
}
